/** axios封装
 * 请求拦截、相应拦截、错误统一处理
 */
axios.defaults.timeout = 50000
// post请求头
axios.defaults.headers.post['X-Requested-With'] = 'XMLHttpRequest'
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
// axios.defaults.headers.post['api-version'] = '1.0'
// axios.defaults.headers.post['ServerDesc'] = 'H5'
// axios.defaults.headers["Access-Control-Allow-Credentials"] = true
axios.withCredentials = true
// 请求拦截器
axios.interceptors.request.use(config => {
    return config
})
// 响应拦截器
axios.interceptors.response.use(response => {
    if (response.status == 200) {
        return response.data;
    } else {
        throw response.data;
    }
}, error => {
    return Promise.reject(error);
});

